package com.pmcc.platform.shop.web;


import com.alibaba.fastjson.JSONObject;
import com.pmcc.platform.shop.entity.ShopInfo;
import com.pmcc.platform.shop.service.ShopInfoService;
import com.pmcc.platform.shop.vo.AddressVo;
import com.pmcc.utils.AntPage;
import com.pmcc.utils.ApiResultBean;
import com.pmcc.utils.wechat.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("api/v1/shop")
public class ShopInfoController {

    @Autowired
    ShopInfoService shopService;


    /**
     * 查询所有商铺信息
     *
     * @param antPage
     * @return
     */
    @RequestMapping(value = "/queryAllShop", method = RequestMethod.GET)
    @ResponseBody
    public ApiResultBean queryAllShop(AntPage antPage,String name,String bossName,String  provinces,String city,String area ){

        return  shopService.queryAllShop(antPage,name,bossName,provinces,city,area);

    }

    /**
     * 查看店铺信息
     * @param shopId
     * @return
     */
    @RequestMapping(value = "/queryShop", method = RequestMethod.GET)
    @ResponseBody
    public ApiResultBean queryShop(String shopId){
        return  shopService.queryShop(shopId);

    }


    /**
     * 修改店铺信息
     * @param shopInfo
     * @return
     */
    @RequestMapping(value = "/modifyShop", method = RequestMethod.POST)
    @ResponseBody
    public ApiResultBean modifyShop(ShopInfo shopInfo){
        return  shopService.modifyShop(shopInfo);

    }

    /**
     * 删除店铺
     * @param shopId
     * @return
     */
    @RequestMapping(value = "/deletShop", method = RequestMethod.POST)
    @ResponseBody
    public ApiResultBean deletShop(String shopId){
        return  shopService.deletShop(shopId);
    }

    /**
     * 添加店铺
     * @param shopInfo
     * @return
     */
    @RequestMapping(value = "/addShop", method = RequestMethod.POST)
    @ResponseBody
    public ApiResultBean addShop(ShopInfo shopInfo){
        return  shopService.addShop(shopInfo);
    }

    @RequestMapping(value = "/test", method = RequestMethod.GET)
    @ResponseBody
    public  AddressVo  test(String prapeze){

        return shopService.gain(prapeze);
    }


    /**
     * 查看当前店铺下面的导购信息
     * @param shopId
     * @return
     */
    @RequestMapping(value = "/queryshopping", method = RequestMethod.GET)
    @ResponseBody
    public ApiResultBean queryshoping(String shopId,AntPage antPage){
        return  shopService.queryshoping(shopId,antPage);

    }





}
